from PyQt5.QtWidgets import QPushButton, QTableWidgetItem, QHeaderView

from frw.vacwx import IVacWidget

class TablePageVac(IVacWidget):
    subpage_mapping = []

    def __init__(self, parent=None):
        super().__init__(parent)
        self._import()
        self._active()

    def _import(self):
        self.data = None
        # table of the page...

        self.table_data_init(self.data) 
        self.table_showing_style()

    def table_showing_style(self):
        header = self.tableWidget.horizontalHeader()
        for column_index in range(len(self.subpage_mapping)):
            header.setSectionResizeMode(column_index, QHeaderView.Stretch)  # ResizeToContents

    def table_data_init(self, iodata):
        self.tableWidget.clearContents()
        self.tableWidget.setRowCount(0)

    def _active(self):
        pass